import { Tabs } from 'antd';
import { Table } from 'antd';
import React from 'react';
import request from '@/http';
import All_style from '../../index.less';
const { TabPane } = Tabs;
const columns = [
  {
    title: '项目名称',
    dataIndex: 'courseName',
    key: 'courseName',
  },
  {
    title: '小组名称',
    dataIndex: 'teamName',
    key: 'teamName',
  },
  {
    title: '个人得分',
    dataIndex: 'personalScore',
    key: 'personalScore',
  },
  {
    title: '小组得分',
    dataIndex: 'teamScore',
    key: 'teamScore',
  },
  {
    title: '小组排名',
    dataIndex: 'rank',
    key: 'rank',
  },
  {
    title: '小组排行榜',
    dataIndex: 'teamRank',
    key: 'teamRank',
    render: (text: any, row: any) => {
      return (
        <>
          {row?.teamRank?.map((item: any, index: number) => {
            return (
              <span key={index}>
                {item.rankNo} {item.teamName} <br />
              </span>
            );
          })}
        </>
      );
    },
  },
];
const dataOld = [
  {
    teamID: 2,
    courseName: '在线考试系统',
    teamName: '至尊',
    personalScore: '',
    teamScore: '',
    rank: '',
    teamRank: [
      {
        rankNo: 1,
        teamId: 6,
        teamName: '亿点点',
        teamScore: '95.0',
      },
    ],
  },
];
const Project = () => {
  const [data, setData] = React.useState(dataOld);
  const loadData = async () => {
    const result: any = await request.post('/information/student/getScore', {
      page: 1,
      number: 6,
    });
    console.log(result.data);
    if (result.success) {
      setData(result.data.returnDate);
    }
  };
  // React.useEffect(() => {
  //   loadData();
  // }, []);
  return (
    <Table columns={columns} dataSource={data} className={All_style.table2} />
  );
};
export default Project;
